/**
 * 
 */
package edu.pku.sei.modeler.figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.graphics.Color;

/**
 * @author YanYan
 *
 */
public class FinalStateFigure extends CommonFigure {

	public static final org.eclipse.swt.graphics.Color ACTIVITYFINALNODE_COLOR = new Color(null,175,178,239);
	public IFigure root = null;
	public IFigure circleIn = null;
	
	public FinalStateFigure(){
		super();
		XYLayout xyL = new XYLayout();
		setLayoutManager(xyL);
		setOpaque(true);
		
		root = new Ellipse();
		root.setOpaque(false);
		root.setForegroundColor(ColorConstants.black);
		add(root);
		
		circleIn = new Ellipse();
		circleIn.setOpaque(true);
		circleIn.setBackgroundColor(ColorConstants.buttonDarkest);
		add(circleIn);
		
	}
	
	public void setBounds(Rectangle rect) {
		super.setBounds(rect);
		if (root != null)
			root.setSize(rect.width, rect.height);
		if(circleIn != null){
			circleIn.setSize((int)(rect.width*0.6), (int)(rect.height*0.6));
			circleIn.setLocation(new Point((int)(rect.width*0.2)+rect.x, (int)(rect.height*0.2)+rect.y));
		}
	}
	protected void paintShadow(Graphics g) {
		// TODO: draw the figure's own shadow here
	}
}
